CISC 1110  Lab 11

 

Write a program that reads in a number, prints it, and then tests it in two if-else statements, as described below.

 

The first if-else should have a condition that evaluates to true if the number entered is between 1 and 100, including both end points. If the number is in that range, print the number and "is between 1 and 100"; otherwise, print the number and "is not between 1 and 100".

 

The second if-else should have a condition that evaluates to true if the number entered is greater than 100 or less than 1. If the number is in one of those ranges, print the number and "is outside the range 1 to 100"; otherwise, print the number and  the message "is inside the range 1 to 100".

 

Test the program on various numbers that meet or don=t meet the conditions, like 10, 150, -2, 90, 100, and 1. Either run the program multiple times or put the two if-else statements inside a loop (it is your choice to use either a while or a do-while loop).